    Public Class Form1
            Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
                ' Assigning variable as a string for student name
                Dim studentName As String
                Dim strScore As String
                Dim result As String
                ' Assigning Test Scores as a Decimal
                Dim numScore As Decimal
                ' Assnumigning average as a decimal
                Dim average As Decimal
                ' Assigning counter for repeatable names
                Dim counter As Integer = 1
                ' Assigning counter for Test scores
                Dim scoreCounter As Integer = 1
                For counter = 1 To 3
                    ' Prompting user to enter names
                    studentName = InputBox("Enter Student name" & counter, "Students name")
                    numScore = scoreCounter + scoreCounter + scoreCounter
                    ' Asking for the three given socres
                    For scoreCounter = 1 To 3
                        ' Prompting user to enter students test scores.
                        strScore = InputBox("Enter Score " & scoreCounter, "Students Score", " ")
                        If strScore = "" Then
                            ' Canceling the operation.
                            MsgBox("You have cancelled the grading process")
                            Exit Sub
                        End If
                        If Not IsNumeric(strScore) Then
                            scoreCounter -= 1
                            ' Making sure the scores are numeric to prevent any errors.
                            MsgBox("Score has to be numeric..." & vbCrLf & "Click ok and enter score again")
                        Else
                        End If
                    Next
                    average = numScore / 3
                    ' Giving the end result and averages for the 3 students
                    result &= studentName & "'s Average Grade is:" & calcGrade(average) & vbCrLf
                Next
                MsgBox(result, MsgBoxStyle.OkOnly, "Results")
            End Sub
            Private Function calcGrade(ByVal avg As Decimal) As String
                ' Assigning Grade values for the test scores
                If avg >= 90 Then
                    Return "A"
                ElseIf avg >= 80 Then
                    Return "B"
                ElseIf avg >= 70 Then
                    Return "C"
                ElseIf avg >= 60 Then
                    Return "D"
                ElseIf avg < 59 Then
                    Return "F"
                End If
            End Function
        End Class
